package com.nl.module_main.mock;

import com.nl.lib_core.tool.log.KLog;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import java.util.HashMap;


@RunWith(PowerMockRunner.class)
@PrepareForTest({KLog.class})
public class MockitoTest01 {


    @Rule
    public MockitoRule rule = MockitoJUnit.rule();

    @Mock
    KLog kLog;


    @Mock
    HashMap<String, Integer> mockHashMap;


    @Before
    public void setup() {
        //MockitoAnnotations.initMocks(this); //<--初始化

    }

    @Test
    public void init() {
        kLog = PowerMockito.mock(KLog.class);
        kLog.d("TAGGG?????????????", "初始化成功");
    }

    @Test
    public void createClass() {
        //HelloWorld helloWorld = Mockito.mock(HelloWorld.class);
        mockHashMap.put("1", 1);
        //   Assert.assertEquals(0, mockHashMap.size());
    }


//    public void


}
